package main

import "fmt"

func Filter(s []int, fn func(int) bool) []int {
	result:=make([]int,0)

	for _,v:=range s {
		if fn(v) {
			result=append(result,v)
		}
	}

	return result
}

func isEven(input int) bool {
	return input % 2 == 0
}

func main() {
	s:=[]int{1,2,3,4,5,6,7,8,9}
	r:=Filter(s,isEven)

	fmt.Println(r)
}
